/* Programme C macro-généré par bop2c 1.0.16 : 14:57:47, le 09/04/08 */

#include <stdlib.h>
#include <stdio.h>

void pipe01(char *s, int num, FILE *fic)
{
    int r = 0;
    unsigned char c = ' ';

    for( r=0; r<num; r++){
       c = fgetc(fic);
       if (c == '\n'){
           fprintf(stderr, "PROTOCOLE PIPE 01 ERROR\n");
           fprintf(stderr, "arite donnee : %d, attendue : %d\n", r, num);
           fflush(stderr);
           exit(1);
       }
       s[r] = c;
     }

    while (c != '\n'){
       c = fgetc(fic);
    }
}
unsigned char input_string[8];
void input( unsigned char *e0, unsigned char *e1, unsigned char *e2, unsigned char *e3, unsigned char *e4, unsigned char *e5, unsigned char *e6, unsigned char *e7){
 pipe01(input_string, 8, stdin);
 *e0=(input_string[0]=='1');
 *e1=(input_string[1]=='1');
 *e2=(input_string[2]=='1');
 *e3=(input_string[3]=='1');
 *e4=(input_string[4]=='1');
 *e5=(input_string[5]=='1');
 *e6=(input_string[6]=='1');
 *e7=(input_string[7]=='1');
}
unsigned char output_string[5] = {'0','0','0','0','\0'};
void output( unsigned char e0, unsigned char e1, unsigned char e2, unsigned char e3){
 output_string[0] = e0 ? '1' : '0';
 output_string[1] = e1 ? '1' : '0';
 output_string[2] = e2 ? '1' : '0';
 output_string[3] = e3 ? '1' : '0';
 fprintf(stdout, "%s\n", output_string);
 fflush(stdout);
}

unsigned char r, s_0_0, s_0_1, s_0_2, s_0_3, s_0_4, s_0_5, s_0_6, s_0_7, s_1_0, s_2_0, s_3_0, s_4_0, s_6_0, s_7_0, s_8_0, s_9_0, s_10_0, s_11_0, s_12_0, s_13_0, s_14_0, s_15_0, s_16_0, s_17_0, s_18_0, s_19_0, s_20_0, s_21_0, s_22_0, s_23_0, s_24_0, s_25_0, s_26_0, s_27_0, s_28_0, s_29_0, s_30_0, s_31_0, s_32_0, s_33_0, s_34_0, s_35_0, s_36_0, s_37_0, s_38_0, s_39_0, s_40_0;

int main(int argc, char **argv){
    int ncy = 1, index_cy = 0;
    if (argc>1) r = sscanf(argv[1], "%d", &ncy);

/* BEGIN assign init */
s_1_0=0;s_2_0=1;s_3_0=0;s_4_0=1;
/* END assign init */

    while(index_cy < ncy){
/* BEGIN netlist */
input( &s_0_0, &s_0_1, &s_0_2, &s_0_3, &s_0_4, &s_0_5, &s_0_6, &s_0_7);
output( s_1_0, s_2_0, s_3_0, s_4_0);
s_6_0=!s_0_4;
s_7_0=!s_0_5;
s_8_0=!s_0_6;
s_9_0=!s_0_7;
s_10_0=1;
s_11_0=s_0_0&&s_6_0;
s_12_0 = (s_0_0) ? (!s_6_0) : (s_6_0);
s_13_0=s_0_1&&s_7_0;
s_14_0 = (s_0_1) ? (!s_7_0) : (s_7_0);
s_15_0=s_0_2&&s_8_0;
s_16_0 = (s_0_2) ? (!s_8_0) : (s_8_0);
s_17_0=s_0_3&&s_9_0;
s_18_0 = (s_0_3) ? (!s_9_0) : (s_9_0);
s_19_0=s_10_0;
s_20_0=s_0_0&&s_19_0;
s_21_0=s_11_0||s_20_0;
s_22_0=s_6_0&&s_19_0;
s_23_0=s_21_0||s_22_0;
s_24_0=s_0_1&&s_23_0;
s_25_0=s_13_0||s_24_0;
s_26_0=s_7_0&&s_23_0;
s_27_0=s_25_0||s_26_0;
s_28_0=s_0_2&&s_27_0;
s_29_0=s_15_0||s_28_0;
s_30_0=s_8_0&&s_27_0;
s_31_0=s_29_0||s_30_0;
s_32_0=s_0_3&&s_31_0;
s_33_0=s_17_0||s_32_0;
s_34_0=s_9_0&&s_31_0;
s_35_0=s_33_0||s_34_0;
s_36_0=s_35_0;
s_37_0 = (s_18_0) ? (!s_31_0) : (s_31_0);
s_38_0 = (s_16_0) ? (!s_27_0) : (s_27_0);
s_39_0 = (s_14_0) ? (!s_23_0) : (s_23_0);
s_40_0 = (s_12_0) ? (!s_19_0) : (s_19_0);

if(1)s_1_0=s_40_0;
if(1)s_2_0=s_39_0;
if(1)s_3_0=s_38_0;
if(1)s_4_0=s_37_0;

/* END netlist */
    if(r)index_cy++;
    }
    return(0);
}
